package com.zy.studentSide.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.zy.studentSide.entity.StudentTask;
import com.zy.studentSide.entity.StudentTaskFile;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * @author 29787
 */
@Mapper
@Component
public interface StudentTaskFileDao extends BaseMapper<StudentTaskFile> {

    /**
     * 查询附件信息
     * @param taskId
     * @param studentId
     * @return StudentTaskFile
     */
    @Select("select * from hms_student_task_file where task_id=#{taskId} and student_id=#{studentId}")
    StudentTaskFile getStudentTaskFileById(Integer taskId, Integer studentId);

    /**
     * 根据作业id，学生id，附件id查询附件信息
     * @param taskId
     * @param studentId
     * @param uploadFileId
     * @return StudentTaskFile
     */
    @Select("select * from hms_student_task_file where upload_file_id=#{uploadFileId} and task_id=#{taskId} and student_id=#{studentId}")
    StudentTaskFile getStudentTaskFile(Integer taskId, Integer studentId,Integer uploadFileId);

}
